package no.sachmuld.methodcombination.impl.validate;

/**
 *
 */
public abstract class MethodCombinationValidationError {

    private Class targetClass;

    protected MethodCombinationValidationError(Class targetClass) {
        this.targetClass = targetClass;
    }

    public Class getTargetClass() {
        return targetClass;
    }

    protected static String format(String methodName, Class[] parameterTypes) {
        StringBuilder sb = new StringBuilder();
        sb.append(methodName);
        sb.append("(");
        for (int i = 0; i < parameterTypes.length; i++) {
            sb.append(parameterTypes[i].getSimpleName());
            if (i < parameterTypes.length - 1) {
                sb.append(", ");
            }
        }
        sb.append(")");
        return sb.toString();
    }

}
